Skip to content

Conversation

@Rony-2004
Copy link

Add MatrixDeterminant Algorithm

Description

This PR adds a new algorithm to calculate the determinant of a square matrix.
It supports any n × n matrix using recursion to compute minors.

Problem Statement

  • Implement a function to calculate the determinant of a square matrix.
  • Only square matrices are allowed; throw an exception or handle error for non-square matrices.
  • Return 0 if the matrix is singular (determinant = 0).

Example

double[][] matrix1 = {{1,2},{3,4}};
determinant(matrix1); // returns -2

double[][] matrix2 = {{2,0,1},{3,0,0},{5,1,1}};
determinant(matrix2); // returns 3

@codecov-commenter
Copy link

codecov-commenter commented Oct 26, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.29%. Comparing base (a4cf6e3) to head (c21c414).

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #6949      +/-   ##
============================================
+ Coverage     78.26%   78.29%   +0.03%     
- Complexity     6567     6578      +11     
============================================
  Files           743      744       +1     
  Lines         21886    21911      +25     
  Branches       4284     4293       +9     
============================================
+ Hits          17129    17156      +27     
+ Misses         4074     4073       -1     
+ Partials        683      682       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Rony-2004 Rony-2004 closed this Oct 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants